// 备注组件设置
export default {
  props: {
    value: [String, Number],
    options: Object
  },
  render(h) {
    const value = this.options.data && this.options.data[this.value]
    if (value instanceof Object) {
      const opts = Object.assign(
        {
          size: 'mini',
          class: '',
          color: '',
          effect: 'light',
          border: false,
          label: this.value
        },
        value
      )

      return h(
        'el-tag',
        {
          props: {
            size: opts.size,
            color: opts.color,
            type: opts.class,
            hit: opts.border,
            effect: opts.color ? 'dark' : opts.effect
          }
        },
        opts.label
      )
    } else {
      return h('div', value)
    }
  }
}
